from PyQt5.QtCore import QThread
from socket import *


class SetCommandThread(QThread):
    def __init__(self, addr, command):
        super(SetCommandThread, self).__init__()
        self.addr = addr
        self.command = command

    def run(self):
        udp_socket = socket(AF_INET, SOCK_DGRAM)
        udp_socket.sendto(self.command.encode(), (self.addr, 6666))
